// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

int t, n, m;
const int N = 1e5+50, M = 20;

int dp[M][1 << 20];

int a[M][M], b[M][1 << M], cost[1 << M];

char s[N];

int mp[1 << M];

inline void update(int &a, int b) {
    if (b == -1)
        return;
    if (a == -1 || a > b)
        a = b;
}

inline int lowbit(int x) {
    return x & (-x);
}

int main(int argc, char const *argv[]) {
    // code
    scanf("%d%d", &n, &m);
    scanf("%s", s);
    for (int i=0; i<n-1; ++i) {
        int u = s[i] - 'a',
        v = s[i+1]-'a';
        if (u == v) continue;
        ++a[u][v];
        ++a[v][u];
    }

    for (int i=0; i<m; ++i)
        mp[1 << i] = i;



    for (int mask=0; mask < (1 << m); ++mask) {
        static int tmp[M], tcnt, t2[M], t2cnt;
        int t = mask;
        tcnt = 0;
        for (int x=lowbit(t); t; t-=x, x=lowbit(t)) {
            tmp[tcnt++] = mp[x];
        }
        for (int i=0; i<m; ++i) {
            if ((mask >> i) & 1)
                continue;
            for (int j=0; j<tcnt; ++j)
                cost[mask] += a[i][tmp[j]];
        }
    }
    memset(dp, -1, sizeof dp);
    // dp[0][0] = 0;
    int lim = (1 << m) - 1;
    for (int i=0; i<m; ++i)
        dp[i][1<<i] = 0;
    for (int mask=0; mask < (1 << m); ++mask) {
        static int tmp[M], tcnt;
        tcnt = 0;
        int t = mask;
        for (int x=lowbit(t); t; t-=x, x=lowbit(t))
            tmp[tcnt++] = mp[x];
        for (int ix = 0; ix < tcnt ; ++ix) {
            int i = tmp[ix];
            dbg(i, mask);
            for (int j=0; j<m; ++j) {
                if ((mask >> j) & 1)
                    continue;

                int nextmask = mask ^ (1 << j);

                update(dp[j][nextmask], dp[i][mask] + cost[mask]);
                // dbg(i, mask, j, nextmask, dp[i][mask], dp[j][nextmask]);
            }
        }
    }
    int ans = -1;
    for (int i=0; i<m; ++i)
        update(ans, dp[i][(1<<m) - 1]);
    printf("%d\n", ans);
    return 0;
}
